#include <iostream>


class BaseA
{
public:
    BaseA()
    {
        std::cout<<"BaseA构造函数"<<std::endl;
    }
    void show()
    {
        std::cout<<"BaseA"<<std::endl;
    }
};

class BaseB
{
public:
    BaseB()
    {
        std::cout<<"BaseB构造函数"<<std::endl;
    }
    void show()
    {
        std::cout<<"BaseB"<<std::endl;
    }
};

//多继承中,父类调用构造的顺序和继承顺序相关
class Derived:public BaseB,public BaseA
{
public:
    Derived()
    {
        std::cout<<"子类构造函数"<<std::endl;
    }
};

int main()
{
    Derived d;
    d.show();
    return 0;
}